#ifndef _QUEUE_H
#define _QUEUE_H 

template <typename T>
struct Node
{
	T elem;
	Node<T>* next;
	Node(T val):elem(val){};
};

template <typename T>
class Queue
{
	Node<T>* front;
	Node<T>* rear;
public:
	Queue():front(NULL),rear(NULL){};
	~Queue();
	void Add(T t);			//入队
	bool IsEmpty();			//队空
	void (T t);
	T FrontVal();
	void DeQueue(Node<T>* t);
};

template <typename T>
void Queue<T>::(T t){
	if(front == NULL){
		Node<T>* tmp = new Node<T>(t);
		front = tmp;
		rear = tmp;
	}
	else{
		Node<T>* tmp = new Node<T>(t);
		rear->next = tmp;
		rear = tmp;
	}
}
template <typename T>
Queue<T>::~Queue(){
	Node<T>* cur = front;
	while(cur){
		DeQueue(cur);
		cur = cur->next;
	}
}
template <typename T>
void Queue<T>::DeQueue(){
	if(front){
		Node<T>* tmp = front;


	}
}
template <typename T>
bool Queue<T>::IsEmpty(){
	return (front==NULL);
}
template <typename T>
T Queue<T>::FrontVal(){
	return front->elem;
}
template <typename T>
void Queue<T>::Add(T t){
	if(front == NULL){
		Node<T>* tmp = new Node<T>(t);
		front = tmp;
		rear = tmp;
	}
	else{
		Node<T>* tmp = new Node<T>(t);
		rear->next = tmp;
		rear = tmp;
	}
}
#endif
